<template>
  <div>
    <el-table
      v-loading="loading"
      :data="examineFieldList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" type="index" />
      <!-- <el-table-column label="指标类型" align="center" prop="gradeField">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.clr_grade_type" :value="scope.row.gradeField" />
        </template>
      </el-table-column> -->
      <el-table-column label="指标分类名称" show-overflow-tooltip align="center" prop="classifyName" />
      <el-table-column label="指标名称" show-overflow-tooltip align="center" prop="name" />
      <el-table-column label="最高分" sortable align="center" prop="score" />
      <el-table-column label="状态" show-overflow-tooltip align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.common_status" :value="scope.row.status" />
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['clr:examineField:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['clr:examineField:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    
  </div>
</template>
<script>
export default {
  name: "tableList",
  dicts: ["common_status", "clr_grade_type"],
  props: {
    examineFieldList: {
      type: Array,
      default: [],
    },
  },
  watch:{
    examineFieldList: {
            handler (newVal, oldVal) { // newVal是获取的是新的值
                this.examineFieldList = newVal
            },
        }
    },
  data() {
    return {
        ids: [],
        loading: false,
    }
  },
  methods: {
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.$emit('handleSelectionChange', selection)
    //   this.ids = selection.map(item => item.cefId)
    //   this.single = selection.length !== 1
    //   this.multiple = !selection.length
    },
    handleUpdate(row) {
        this.$emit('handleUpdate',row)
    },
    handleDelete(row) {
        this.$emit('handleDelete',row)
    },
  }
};
</script>